<div class="container_16">
    <div class="push_1 grid_12 containerHeight">
        <h2><?=lang("misPrestamos");?></h2>

        <div id="cuentas">
            <?php foreach ($cuentas as $c): ?>
            <h3 style="padding-left: 25px"><?=$c->codigoEntidad?> - <?=$c->codigoControl?> - <?=$c->codigoControl?>
                - <?=$c->codigoCuenta?></h3>
            <div>
                <table id="prestamos<?=$c->id?>">
                    <thead>
                    <tr>
                        <th><?=lang('presImporte')?></th>
                        <th><?=lang('presCuotaPlazo')?></th>
                        <th><?=lang("estado");?></th>
                    </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($prestamos[$c->id] as $p): ?>
                    <tr>
                        <td><?php $importe = str_replace(".", ",", $p->importe);
                            echo number_format($p->importe, 2, ",", ".") . " €";?></td>
                        <td>
                            <?php if ($p->cuota == "") {
                            echo lang('presPlazo') . $p->plazo . lang('meses');
                        } else {
                            echo lang('cuota') . $p->cuota . " €";
                        } ?>
                        </td>
                        <td><?=lang($p->tag)?></td>
                    </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <script>
                    $(document).ready(function () {
                        $('#prestamos' +<?= $c->id ?>).dataTable({
                            "bJQueryUI":true,
                            "bInfo":false,
                            "bSort":false,
                            "bPaginate":false,
                            "oLanguage":{
                                "sUrl":"<?= lang('datatables_lng') ?>"
                            }
                        });
                    });
                </script>
            </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $("#cuentas").accordion({
            collapsible:true,
            active:0,
            autoHeight:false
        });
    });
</script>
<style>
    .dataTables_filter {
        display: none;
    }
</style>